<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/vue.js"></script>
    <style>
        .coRed{
            color: red;
        }
    </style>
</head>
<body>
<ul id="ul_id">
    <li v-for="(m,index) in arrays" v-bind:class="{coRed:index==cIndex}" v-on:click="changeColor(index)">{{m}}</li>
</ul>

<script>
    const app=new Vue({
        el:"#ul_id",
        data:{
            arrays:['123','456','789','012'],
            coRed:"coRed",
            cIndex:0
        },
        methods: {
            changeColor: function (index) {
                this.cIndex=index;
                //changeColor($event) console.log(e.currentTarget) 取当前元素
            }
        }
    })
</script>

</body>
</html>